package u13.ejercicio17;

import java.awt.Graphics;
import java.util.Random;

import javax.swing.JPanel;

public class Lienzo extends JPanel{
	private int x;
	private int y;
	private int w;
	private int h;
	private int anchoVentana;
	private int altoVentana;
	private boolean relleno=false;
	public Lienzo(int anchoVentana, int altoVentana){
		this.anchoVentana=anchoVentana;
		this.altoVentana=altoVentana;
	}
	//COGER EL EJERCICIO DE ALBERTO
	public int getPosX(){
		return x;
	}
	public int getPosY(){
		return y;
	}
	public int getAncho(){
		return w;
	}
	public int getAlto(){
		return h;
	}
	public void paint(Graphics g){
		Random r=new Random();
		x=r.nextInt(anchoVentana-w);
		y=r.nextInt(altoVentana-h);
		w=r.nextInt(51)+50;
		h=r.nextInt(51)+50;
		if(relleno){
			
		}else{
			g.drawRect(x, y, w, h);
		}
		
	}

}
